import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';

import {MainComponent} from './main/main.component';
import {MembersComponent} from './members/members.component';
import {Page404Component} from './page404/page404.component';
import {UserComponent} from './user/user.component';

const routes: Routes = [
  {path: '', redirectTo: "/main", pathMatch: "full"},
  {path: 'main', component: MainComponent},
  {
    path:'routers',
    loadChildren : './routers/routers.module#RoutersModule'
  },
  {path: 'members', component: MembersComponent},
  {path: 'user', component: UserComponent},
  {path: '**', component: Page404Component},
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {useHash: true})],
  exports: [RouterModule],
  providers: []
})
export class AppRoutingModule {
}
